<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p>push 方法用于在数组的末端添加一个或多个元素，并返回添加新元素后的数组长度。注意，该方法会改变原数组</p>
    <script>
        var username = ["iwen","ime","liu","wan"];
        console.log(username.push("i","love","you"));//返回数组长度7
        console.log(username);

        var arr = [];
        arr.push("尚学堂");
        arr.push("itbaizhan");
        arr.push("true,{}");
        console.log(arr);

        var arr1 = ["xst","itbaizhan","WEB前端"];
        arr1.pop();//删除数组的最后一个元素    ["xst","itbaizhan"]
        arr1.pop();//删除数组的最后一个元素    ["xst"]
        console.log(arr1);
        
        
        
    </script>
    <p>pop 方法用于删除数组的最后一个元素，并返回该元素。注意，该方法会改变原数组</p>
</body>
</html>